package test.tuanzi;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @Description
 * @Author Firenut
 * @Date 2023-08-26 10:51
 */
public class T2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 保存每个人的编号 及花费的金额
        Map<Integer, Integer> map = new HashMap<>();

        int n = in.nextInt();
        int m = in.nextInt();

        for (int i = 0; i < n; i++) {
            int k = in.nextInt(); // 吃饭总人数
            int c = in.nextInt(); // 总开销
            int avg = k % c == 0 ? c / k : (c / k) + 1;
            for (int j = 0; j < k - 1; j++) {
                int index = in.nextInt();
                if (map.containsKey(index)) {
                    map.put(index, map.get(index) + avg);
                } else {
                    map.put(index, avg);
                }
            }
        }
//        for (Map.Entry<Integer,Integer> entry : map.entrySet()) {
//            System.out.print(entry.getValue() + " ");
//        }

        for (int i = 1; i < m+1; i++) {
            if(map.containsKey(i)){
                System.out.print(map.get(i));
            }else{
                System.out.print(0);
            }
        }
    }
}
